{extend name="property/public/insidePageBase" /}
{block name="title"}报销单详情{/block}
{block name="css"}
{__block__}
<style>
    body{ margin:0; }
    .layui-iconpicker-body.layui-iconpicker-body-page .hide {display: none;}
    body .layui-iconpicker .layui-iconpicker-icon-item{
        width: 20.1%;
    }
    body{ background-color: #ffffff; }
    .layui-upload-img-box {float:left; margin-bottom: 1px; margin-right: 1px; background: #e0e0e0; }
    .layui-upload-img { width: 100px; height: 100px;}
    .fee_table{ width: 100%;}
    .fee_table td,th{ border:1px solid #444444; }
    .fee_table thead th{height: 10px; background: #e6f4ff; }
    .fee_table tbody td{padding:10px 2px; }
    .text-box { margin:5px 0; }
    @page { margin: 5mm; }
    .tableHe { width: 100%; margin-bottom: 30px; }
    .tableHe td { padding:4px 9px;  }
</style>
{/block}
{block name="body"}
<div class="layuimini-container">
    <div class="layuimini-main">
        <div id="print_html" style="width: 90%;margin-left: 5%;font-size: 12px;color: #444;font-family: 'Microsoft YaHei'">
            <table class="tableHe" border="1" cellspacing="0">
                <tr>
                    <td colspan="12">
                        <div style="text-align:center;font-size:16px;color#111111;padding:5px;">报销申请单</div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">申&nbsp;&nbsp;请&nbsp;&nbsp;人</td>
                    <td colspan="2">{$info['userInfo']['username']??''}</td>
                    <td colspan="2">申请时间</td>
                    <td colspan="2">{$info['add_time']}</td>
                    <td colspan="2">报销金额</td>
                    <td colspan="2">¥ {$info['amount']}</td>
                </tr>
                <tr>
                    <td colspan="2">说&nbsp;&nbsp;明</td>
                    <td colspan="10">{$info['use_time']}  用于 <b style="color: red">{$info['cateInfo']['cate_name']??''} </b> | {$info['remark']??''}</td>
                </tr>

                {foreach $info['receivesListData'] as $k=>$v}
                <tr>
                    <td colspan="2">
                        {if $v.verify_type == 1}  审&nbsp;&nbsp;批&nbsp;人 {/if}
                        {if $v.verify_type == 2}  汇&nbsp;&nbsp;报&nbsp;至 {/if}
                        {if $v.verify_type == 3}  抄&nbsp;&nbsp;送&nbsp;至 {/if}
                    </td>
                    <td colspan="2">{$v['presentUserInfo']['username']??''}</td>
                    <td>审批结果</td>
                    <td colspan="2">
                        {if $v.status == 1}  待审批 {/if}
                        {if $v.status == 3}  <b style="color: red;">审核失败 </b>   {/if}
                        {if $v.status == 9}  <b style="color: green;">己同意 </b> {/if}
                    </td>
                    <td>审批时间</td>
                    <td colspan="4">
                        {if $v.status == 1}
                        --
                        {elseif $v['status'] == 3 || $v['status'] == 9 /}
                        {$v['audit_time']}
                        {/if}
                    </td>
                </tr>
                {/foreach}

                {foreach $info['copyListData'] as $k=>$v}
                <tr>
                    <td colspan="2">
                        {if $v.verify_type == 1}  审&nbsp;&nbsp;批&nbsp;人 {/if}
                        {if $v.verify_type == 2}  汇&nbsp;&nbsp;报&nbsp;至 {/if}
                        {if $v.verify_type == 3}  抄&nbsp;&nbsp;送&nbsp;至 {/if}
                    </td>
                    <td colspan="2">{$v['presentUserInfo']['username']??''}</td>
                    <td>查阅结果</td>
                    <td colspan="2">
                        {if $v.is_check == 1}  <b style="color: red;">待查阅 </b>{/if}
                        {if $v.is_check == 2}  <b style="color: green;">己阅读</b> {/if} </td>
                    <td>查阅时间</td>
                    <td colspan="4">
                        {if $v.is_check == 1}
                        --
                        {elseif $v['is_check'] == 2/}
                            {$v['read_time']}
                        {/if}
                    </td>
                </tr>
                {/foreach}
                <tr>
                    <td colspan="2">附&nbsp;&nbsp;件</td>
                    <td colspan="10">
                        <span class="layui-input-block" id="image_info">
                            <span class="layui-upload-list" id="img_show">
                                {foreach $info['picture'] as $k=>$v}
                                <span class="layui-upload-img-box" id="{:md5($v)}-{$k}">
                                    <img src="{$v}" class="layui-upload-img checkPictureByImg">
                                    <input type="hidden" name="picture[]" value="{$v}">
                                </span>
                                {/foreach}
                            </span>
                        </span>
                    </td>
                </tr>
            </table>
        </div>
        <div style="text-align: center">
            <button class="layui-btn layui-btn-primary no-print" onclick="print()">打印</button>
        </div>
    </div>
</div>
{/block}
{block name="js"}
{__block__}
{js href="/static/common/js/jQuery.print.js" /}
<script>
    function print(){
        var url = '{:url("propertyApprovalFlowPrint")}';
        var loadAdd = layer.msg('提交中', {icon: 16, time: 0, shade: 0.1, offset: '15px'});
        $.post(url, {id:{$info['flow_id']??''}}, function (res) {
            layer.close(loadAdd);
            if (res.code === 0) {
                $('#print_num').html(parseInt($('#print_num').html())+1)
                $("#print_html").print({
                    noPrintSelector: ".no-print"
                });
                layer.msg(res.msg, {icon: 6, offset: '15px'});
            } else {
                layer.msg(res.msg, {icon: 5, offset: '15px'});
            }
        });
    }
</script>
{/block}